-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: cover all tests #1011
chore: cover all tests #1011
Conversation
|
9cae762
to
c1bc133
Compare
bcf8874
to
f2b2433
Compare
Do we need snapshot testing for all tests? Seems like these are rather short and can be asserted entirely with a single string. The features are also well-defined and isolated (and unlikely to have internal implementation change). I think it's fine to leave it as is, and perhaps leave snapshots for larger file outputs only that's hard to assert and susceptible to internal implementation change. |
That's my question from me to you, as you have more knowledge than me, background-wise. I hope you can tell me which tests don't need a snapshot and why. From what I can tell, ALL tests use a transformation step, which is the whole point of the snapshot. |
The printer tests are the ones that should be a snapshot. But from this PR it doesn't look like the old manual tests are removed. So I don't think I am following what is going on. |
|
Regarding (2), I think you're saying that you find the print infrastructure useful for creating new tests. But once you've created them, there's not value in keeping them around forever, is there? If the existing printer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't check all the snapshots individually or anything, but this looks fine to me!
Changes
This PR adds snapshot testing to ALL tests.
I also changed a bit the way we create snapshot testing, I created an utility called
MakeSnapshot
insidetest_utils.go
, which accepts certain options to generate the snapshots.Before this PR, the snapshots were stored inside a
__snapshots__
folder, but I preferred to configure that value, and pass a specific folder for each test suite we're testing. I found dividing snapshots by test case to be nice.Testing
CI should pass
Docs
N/A